#-*-coding:utf-8-*-
from app import db
from flask_login import UserMixin

# 定义flask-login的user表
# class User(UserMixin, db.Model):
# 	__tablename__ = 'user'
# 	id = db.Column(db.Integer, primary_key = True)
# 	email = db.Column(db.String(64), unique=True, index=True)
# 	username = db.Column(db.String(64), unique=True, index=True)
# 	password = db.Column(db.String(128))
# 	role_id = db.Column(db.Integer, db.ForeignKey('roles.id'))

# 定义flask-login的roles表
# class Role(db.Model):
# 	__tablename__ = 'roles'
# 	id = db.Column(db.Integer, primary_key=True)
# 	name = db.Column(db.String(64), unique=True)
# 	default = db.Column(db.Boolean, default=False, index=True)
# 	permissions = db.Column(db.Integer)
# 	users = db.relationship('User', backref='role', lazy='dynamic')